﻿using Mrc.SqlSurging.DBContext;
using System;
using System.Collections.Generic;
using System.Text;

namespace Mrc.SqlSurging
{
    public class InitSqlSurgingEntities
    {
        /// <summary>
        /// 生成实体
        /// </summary>
        public static void initDBEntity()
        {
            new SugarClientHelper().GetSqlSugarClient()
            .DbFirst
            .IsCreateAttribute()
            .SettingClassTemplate(old =>
            {
                return old.Replace("{Namespace}", "Mrc.Entities");
            })
            .SettingConstructorTemplate(old =>
            {
                return old;//修改构造函数
            })
            .CreateClassFile(AppContext.BaseDirectory+@"\Mrc.Entities\Entities");
        }
    }
}